/* eslint valid-jsdoc: "off" */

'use strict';

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
    /**
   * kujomiva account
   * @type {Egg.EggAppConfig}
   **/
    const account = exports = {};

    // 本地数据库信息
    account.mysql_dev = {
        host: 'localhost',
        port: '3306',
        user: 'root',
        password: 'root',
        database: 'kujomiva'
    };

    // 远程数据库地址
    if (appInfo) {
        account.mysql_pro = {
            host: appInfo.pkg.version.split('.').reverse().join('.'),
            port: '3306',
            user: 'root',
            password: `${appInfo.pkg.description}1043829026`,
            database: 'kujomiva'
        };
    }

    // cos_748
    account.cos_748943649 = {
        account: {
            SecretId: 'AKIDPbXDdnqtqXyB8z9vymKdgSyDCvPcqIl4',
            SecretKey: 'C8pGabOvCDxRfdKlwsY2JMBl7F9pGTRA'
        }
    };

    // cos_104
    account.cos_1043829026 = {
        appid: '1259361798',
        account: {
            SecretId: 'AKIDyoCTgmOT6ZuhKofFCA1meOxSnGgwhzoR',
            SecretKey: 'rdEev3FF8mDWfiaLj6IJAqNn8uBMNGyV'
        }
    };

    // 短信
    account.sms = {
        account: {
            accessKeyId: 'LTAIQczFRNhtxcwe',
            secretAccessKey: '5gjpWZykBqJ3ST21I0MyPg1YcjYAPc'
        },
        options: {
            SignName: '孙浩',
            TemplateCode: 'SMS_140260052'
        }
    };

    return account;
};
